package com.weitu.worklicense.service.impl;

import com.weitu.worklicense.entity.FireLicense;
import com.weitu.worklicense.entity.FireLicenseCriteria;
import com.weitu.worklicense.mapper.FireLicenseMapper;
import com.weitu.worklicense.service.FireLicenseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class FireLicenseServiceImpl implements FireLicenseService {
    private final FireLicenseMapper fireLicenseMapper;

    private static final Logger logger = LoggerFactory.getLogger(FireLicenseServiceImpl.class);

    @Autowired
    public FireLicenseServiceImpl(FireLicenseMapper fireLicenseMapper) {
        this.fireLicenseMapper = fireLicenseMapper;
    }

    @Override
    public int countByCriteria(FireLicenseCriteria example) {
        int count = this.fireLicenseMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public FireLicense selectByPrimaryKey(String id) {
        return this.fireLicenseMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<FireLicense> selectByCriteria(FireLicenseCriteria example) {
        return this.fireLicenseMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.fireLicenseMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(FireLicense record) {
        return this.fireLicenseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByPrimaryKey(FireLicense record) {
        return this.fireLicenseMapper.updateByPrimaryKey(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(FireLicense record, FireLicenseCriteria example) {
        return this.fireLicenseMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(FireLicense record) {
        return this.fireLicenseMapper.insertSelective(record);
    }
}